package com.jinzecloud.reportapproval.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.jinzecloud.reportapproval.bean.VegetationChild;
import com.jinzecloud.reportapproval.service.VegetationChildService;
import com.jinzecloud.reportapproval.utils.PageUtils;
import com.jinzecloud.reportapproval.utils.R;



/**
 * 
 *
 * @author æ­å°
 * @email 1971240051@qq.com
 * @date 2024-12-03 18:28:40
 */
@RestController
@RequestMapping("reportapproval/vegetationchild")
public class VegetationChildController {
    @Autowired
    private VegetationChildService vegetationChildService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("reportapproval:vegetationchild:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = vegetationChildService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("reportapproval:vegetationchild:info")
    public R info(@PathVariable("id") Integer id){
		VegetationChild vegetationChild = vegetationChildService.getById(id);

        return R.ok().put("vegetationChild", vegetationChild);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("reportapproval:vegetationchild:save")
    public R save(@RequestBody VegetationChild vegetationChild){

		vegetationChildService.save(vegetationChild);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("reportapproval:vegetationchild:update")
    public R update(@RequestBody VegetationChild vegetationChild){
		vegetationChildService.updateById(vegetationChild);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("reportapproval:vegetationchild:delete")
    public R delete(@RequestBody Integer[] ids){
		vegetationChildService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
